# -*- coding: utf-8 -*-
"""
Created on Thu Sep 30 16:00:01 2021

@author: Administrator
"""

class Solution:
    def singleNumber(self, A):
        ans = 0
        for x in A:
            ans = ans ^ x #^是按二进制位异或，奇数次为1，偶数次为0！！！
        return ans
    
if __name__ == "__main__":
    temp = Solution()
    List1 = [4,6,4,6,3]
    List2 = [2,1,1,1,1]
    print(("输入："+str(List1)))
    print(("输出："+str(temp.singleNumber(List1))))
    print(("输入："+str(List2)))
    print(("输出："+str(temp.singleNumber(List2))))